package com.alex.wechat.component.handler;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alex.wechat.core.handler.WxAccountType;
import com.alex.wechat.core.handler.WxHandler;
import com.alex.wechat.mp.config.WxConsts;

import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.message.bean.WxXmlMessage;
import me.chanjar.weixin.message.rule.WxMessageHandler;

/**
 * 开放平台取消授权Handler
 * 
 * @author Debenson
 * @since 0.1
 */
@WxHandler(infoType = WxConsts.INFO_TYPE_UNAUTHORIZED, accountType = WxAccountType.COMPONENT)
public class UnauthorizedHandler implements WxMessageHandler {
  private static final Logger logger = LoggerFactory.getLogger(UnauthorizedHandler.class);

  @Override
  public String handle(WxXmlMessage wxMessage, Map<String, Object> context)
      throws WxErrorException {
    if (logger.isDebugEnabled()) {
      logger.debug("开始处理开放平台取消授权消息");
    }
    return WxConsts.SUCCESS_MSG;
  }

}
